<?php

namespace app\admin\validate;

use think\Validate;

class AppBaseConfig extends Validate
{
    //字段规则
    protected $rule = [
        'app_base_id' => 'require|unique:app_base_config',
        'max_quota' => 'require',
        'min_quota' => 'require',
    ];

    //验证器提示信息
    protected $message = [
        'app_base_id.require' => '请选择应用',
        'app_base_id.unique' => '该应用的基础配置已存在',
        'max_quota.require' => '请输入最大额度',
        'min_quota.require' => '请输入最小额度',
    ];

    //使用场景
    protected $scene = [
        'add' => ['app_base_id', 'max_quota', 'max_quota'],
        'edit' => [ 'max_quota', 'max_quota']
    ];
}